#ifndef _DB_H_
#define _DB_H_
#include <sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<string.h>
enum DB_ERR_TYPE
{
	DB_ERR = -1,
	DB_OK
};


int InitDb();
int CreateTable();

int Zhuce(int socketID,char *buffer[]);//用户帐号注册
int Login(int socketID,char *buffer[]);//用户登录;
int Begin(int socketID,char *buffer[]);
int OpenFan(int socketID,char *buffer[]);
int CloseFan(int socketID,char *buffer[]);
int OpenBuzzer(int socketID,char *buffer[]);
int CloseBuzzer(int socketID,char *buffer[]);
int OpenLed(int socketID,char *buffer[]);
int CloseLed(int socketID,char *buffer[]);

int Tmp(int socketID,char *buffer[]);
int Hum(int socketID,char *buffer[]);
int Light(int socketID,char *buffer[]);
int cameraOpen(int socketID,char *buffer[]);
int InsertEnvironment(int tmp,int hum,int light);

int FindCard(char * id);//查找用户注册是否重复
int RID(int socketID,char *buffer[]);//ID 注册
int DID(int socketID,char *buffer[]);//ID 删除

void cmp(int tmp,int hum,int light);

#endif 
